import os,shutil,subprocess

projectDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

frontDir = os.path.join(projectDir , "front")


def sh(cmd,cwd=None) :
	print("sh: "+cmd)
	if not cwd :
		cwd = projectDir
	subprocess.call(cmd,shell=True, cwd=cwd)

sh("npm run build")

sh("cp -R "+frontDir+"/build/static/ " + projectDir+"/static/")
sh("cp -R "+frontDir+"/build/index.html " + projectDir+"/static/")

sh("go build")